from config import HOST


class ApiRegisterLogin:
    # 初始化
    def __init__(self,session):
        self.session = session #获取session对象
        self.__url_register = HOST + "/api/short-link/admin/v1/user" #私有__
        self.__url_login = HOST + "/api/short-link/admin/v1/user/login"


    #注册接口
    def api_register(self,username,pwd,relName,phone,mail):
        data = {"username": username,
                "password": pwd,
                "realName": relName,
                "phone": phone,
                "mail": mail
        }
        return self.session.post(url=self.__url_register,json=data)

        # 登录接口
    def api_login(self,username,pwd):
        data = {"username": username,
                "password": pwd
        }
        return self.session.post(url=self.__url_login,json=data)





